<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Question extends CI_Controller {
     public function addanswer(){
        $id = $this->input->post('id');
        $qid = $this->input->post('qid');
        $answers = $this->input->post('answers');
        $this->load->model('question_model', 'qm');
		$re = $this->qm->insert_answer($id,$qid,$answers);
		if($re){
			echo "<script>alert('update successful');location.href='".$_SERVER['HTTP_REFERER']."'</script>";
		}else{
			echo "<script>alert('update successful');location.href='".$_SERVER['HTTP_REFERER']."'</script>";
		}
     }
}